package com.chance.cc.crawler.development.command.trigger.domain.tenxun;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.tenxun.TenXunCommonScript;
import com.chance.cc.crawler.development.command.job.domain.tenxun.realtime.TenXunNewsRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.tenxun.trace.TenXunNewsTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.CommonCrawlerTestSchedulerTrigger;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author lt
 * @version 1.0
 * @date 2021-03-25 13:05:21
 * @email okprog@sina.com
 */
public class TenXunNewsCrawlerTrigger extends CommonCrawlerTestSchedulerTrigger {
    public static void main(String[] args) {

        publishTenXunNewsRealtimeCrawlerScheduleTriggerInfo();

        publishTenXunNewsTraceCrawlerScheduleTriggerInfo();

    }

    /**
     * 发布腾讯新闻板块2小时采集实时任务trigger info

     */
    public static void publishTenXunNewsRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TenXunNewsRealtimeCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TenXunCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/2 * * ?",
                "腾讯新闻板块实时采集任务执行，每两小时执行一次"
        );
    }

    /**
     * 发布腾讯新闻板块采集回溯任务trigger info

     */
    public static void publishTenXunNewsTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TenXunNewsTraceCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TenXunCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 * * ?",
                "腾讯新闻板块24小时回溯采集任务执行，每天执行一次"
        );
    }
}
